CC=gcc
CINCFLAGS=-I "/usr/include/libxml2/"
ifdef PROFILE
	CPROFFLAGS=-p -pg
else
	CPROFFLAGS=
endif
ifdef RELEASE
	COPTFLAGS=-O3 -s 
else
	COPTFLAGS=-O0 -ggdb3 -Werror -Wall 
endif
CFLAGS=$(CINCFLAGS) $(COPTFLAGS) $(CPROFFLAGS)
LFLAGS=-lz -lxml2
BIN=.

all:$(BIN)/import_osm

$(BIN)/import_osm:import_osm.c $(BIN)/webrequest.o $(BIN)/types.o $(BIN)/projections.o
	@echo --------------- Construction de l\'exécutable ---------------
	@$(CC) $(CFLAGS) -o $(BIN)/import_osm $^ $(LFLAGS)

$(BIN)/%.o:%.c %.h
	@echo --------------- Compilation de $< ---------------
	@$(CC) $(CFLAGS) -c -o $(BIN)/$@ $<

clean:
	rm *.o
	rm import_osm

doc:
	doxygen doxyconf
